/*
 * @Author: wurangkun
 * @Date: 2024-05-20 09:35:56
 * @LastEditTime: 2024-05-22 18:03:05
 * @LastEditors: wurangkun
 * @FilePath: \flutter_example\lib\widgets\KButton.dart
 * @Description: 
 */
import 'package:flutter/material.dart';
import 'package:flutter_screenutil/flutter_screenutil.dart';

class KButton extends StatefulWidget {
  const KButton(
      {super.key,
      required this.child,
      this.onTap,
      this.padding = 16,
      this.borderRadius = 20,
      this.width = 200,
      this.height = 100});
  final Widget child;
  final double borderRadius;
  final double width;
  final double height;
  final double padding;
  final void Function()? onTap;

  @override
  State<KButton> createState() => _KButtonState();
}

class _KButtonState extends State<KButton> {
  @override
  Widget build(BuildContext context) {
    return InkWell(
      onTap: widget.onTap,
      borderRadius: BorderRadius.circular(widget.borderRadius.w),
      child: Ink(
        decoration: BoxDecoration(
          border: Border.all(color: Colors.black),
          borderRadius: BorderRadius.circular(widget.borderRadius.h),
        ),
        padding: EdgeInsets.all(24.w),
        child: widget.child,
      ),
    );
  }
}
